From: Alejandro PiƱeiro Date: Thu, 22 Aug 2013 11:15:00 +0000 (+0200) Subject: Fix key navigation on system menu sliders X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~3648 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=aa569304bc8310cbe19a6bdbc5fca0241b07bf8b;p=gnome-shell.git Fix key navigation on system menu sliders Rely key press events management if the menu item contains a slider. https://bugzilla.gnome.org/show_bug.cgi?id=706386 --- diff --git a/js/ui/slider.js b/js/ui/slider.js index 6005d3d72..e0e786759 100644 --- a/js/ui/slider.js +++ b/js/ui/slider.js @@ -23,7 +23,7 @@ const Slider = new Lang.Class({ this.actor.connect('repaint', Lang.bind(this, this._sliderRepaint)); this.actor.connect('button-press-event', Lang.bind(this, this._startDragging)); this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent)); - this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPressEvent)); + this.actor.connect('key-press-event', Lang.bind(this, this.onKeyPressEvent)); this._releaseId = this._motionId = 0; this._dragging = false; @@ -168,7 +168,7 @@ const Slider = new Lang.Class({ return true; }, - _onKeyPressEvent: function (actor, event) { + onKeyPressEvent: function (actor, event) { let key = event.get_key_symbol(); if (key == Clutter.KEY_Right || key == Clutter.KEY_Left) { let delta = key == Clutter.KEY_Right ? 0.1 : -0.1; diff --git a/js/ui/status/brightness.js b/js/ui/status/brightness.js index 5e586300e..800a7f28a 100644 --- a/js/ui/status/brightness.js +++ b/js/ui/status/brightness.js @@ -47,6 +47,10 @@ const Indicator = new Lang.Class({ this._item.actor.connect('button-press-event', Lang.bind(this, function(actor, event) { this._slider.startDragging(event); })); + this._item.actor.connect('key-press-event', Lang.bind(this, function(actor, event) { + return this._slider.onKeyPressEvent(actor, event); + })); + }, _sliderChanged: function(slider, value) { diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js index a6f288287..b696b1ae4 100644 --- a/js/ui/status/volume.js +++ b/js/ui/status/volume.js @@ -44,6 +44,9 @@ const StreamSlider = new Lang.Class({ this.item.actor.connect('button-press-event', Lang.bind(this, function(actor, event) { this._slider.startDragging(event); })); + this.item.actor.connect('key-press-event', Lang.bind(this, function(actor, event) { + return this._slider.onKeyPressEvent(actor, event); + })); this._stream = null; },